package com.ellricky.baselib.adapter.course

import android.app.Activity
import android.view.View
import com.andr.common.ui.adapter.BaseRecyclerAdapter
import com.andr.common.ui.adapter.SmartViewHolder
import com.ellricky.baselib.R
import com.ellricky.baselib.entity.IdNameEntity
import com.ellricky.baselib.entity.new.CourseType

class CourseTypeSelectAdapter(private val context: Activity) :
        BaseRecyclerAdapter<CourseType>(R.layout.base_adapter_course_type_select) {

    override fun onBindViewHolder(vh: SmartViewHolder, p1: CourseType, position: Int) {
        vh.text(R.id.tvText, p1.course_name)
        vh.text(R.id.tvHeader,p1.course_Ename)
        val viewBg = vh.itemView.findViewById<View>(R.id.view_bg)
        if (p1.isSelect){
            viewBg.alpha = 1f
        }else{
            viewBg.alpha = 0.5f
        }
    }
}

